﻿using Core;

namespace g_gongjianta.battle.fsm
{
    public abstract class AbstractFsmState : Core.Component, IAwake<IFSM, IFSM>
    {
        public abstract int Kind { get; }

        public IFSM Root { get; protected set; }
        public IFSM Parent { get; protected set; }

        public int SkillId { get; set; }

        protected long skillSrl;
        protected ICharacter character;

        public virtual void Awake(IFSM root, IFSM parent)
        {
            Root = root;
            Parent = parent;

            character = Entity as ICharacter;

            Init();
        }

        protected virtual void Init() { }

        public abstract void Enter();

        public abstract void Exit();

        public virtual void Update()
        {

        }
    }
}
